<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>List sản phẩm dạng cột div</title>

<link href="style/css1.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.corner.js"></script>
<script> 
$(document).ready(function()
 { 
 $(".rowcon").corner ("Dog2 30px");

}); 
</script>


</head>

<body>
<?php
include("config/config.php");
$lenh = "select tensp,tentl,soluong,giatien,hinh from sanpham,theloai where sanpham.matl = theloai.matl ";
$kq = mysql_query($lenh);
$sodong = 4;
$sodulieu = mysql_num_rows($kq);
$sotrang = ceil($sodulieu/$sodong);
if(!$_GET["p"])
$p = 1;
else
$p = $_GET["p"];
$x = ($p-1)*$sodong;
$lenh1 = "select tensp,tentl,soluong,giatien,hinh,masp from sanpham,theloai where sanpham.matl = theloai.matl limit $x,$sodong";
$kq1 = mysql_query($lenh1);

?>
<div id="rowcha">
<?php
 while($row = mysql_fetch_array($kq1))
  {
	  ?>
	<div class="rowcon">
   <font color="#0000FF"> Tên:</font> <?php echo $row[0];       ?><br/>
   <font color="#0000FF">Loại:</font>  <?php echo $row[1];       ?><br/>
   <font color="#0000FF">Số lượng:</font>  <?php echo $row[2];       ?><br/>
  <font color="#0000FF">Thành tiền:</font>  <?php echo $row[3];       ?><br/>
  <font color="#0000FF">Mã sản phẩm:</font>  <?php echo $row[5];       ?><br/>
  <img src="image/<?php echo $row[4];       ?>" width="220" height="150" class="hinhsp"/><br/>
  <div class="xemchitiet"><a href="index.php?idsp=<?php echo $row[5];   ?>">Xem chi tiêt >></a></div>
    
    </div><!--rowcon-->
<?php
  }
  ?>
</div><!--rowcha-->
<p align="center" style="clear:both">
<?php
for($i = 1; $i <= $sotrang; $i++)
{
	if($p==$i)
	{
		echo "&nbsp;".$i."&nbsp;";
	}
	else
	{
		?>
    <a href="listspdangcotdiv2.php?p=<?php  echo $i;   ?>"><?php  echo $i;  ?></a>
    <?php
	}		
}
?>
</p>
</body>
</html>